cmake_minimum_required(VERSION 3.28)
project(App)

set(CMAKE_CXX_STANDARD 17)

include_directories(Include)


#set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake;${CMAKE_MODULE_PATH}")
#include(canopen)

set(Boost_DIR ${PROJECT_SOURCE_DIR}/Libraries/boost/cmake)
set(Boost_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/Include)
set(BOOST_ROOT ${PROJECT_SOURCE_DIR}/Libraries/boost)

set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME ON)



find_package(Boost  COMPONENTS program_options REQUIRED)
if(Boost_FOUND)
    include_directories(${Boost_INCLUDE_DIRS})
endif()

add_library(LibSpdLog STATIC IMPORTED)
set_target_properties(LibSpdLog PROPERTIES
        IMPORTED_LOCATION "${PROJECT_SOURCE_DIR}/Libraries/spdlog/libspdlog.a")

add_library(LibSerial STATIC IMPORTED)
set_target_properties(LibSerial PROPERTIES
        IMPORTED_LOCATION "${PROJECT_SOURCE_DIR}/Libraries/serial/libserial.a")

add_executable(
        App
        Source/main.cpp
        Source/SerialManager.cpp
        Source/SerialManager.h
)

target_link_libraries(
        App PUBLIC
        LibSpdLog
        LibSerial
        pthread
        Boost::program_options
)
